#!/bin/bash
WORK_PATH='/usr/liszter/node-server'
cd $WORK_PATH
echo "清理老代码"
git reset --hard origin/master
git clean -f
echo "拉取新代码"
git pull origin master
echo "执行构建"
docker build -t node-server:1.0 .
echo "停止旧容器"
docker stop node-server-container
docker rm node-server-container
echo "启动新容器"
docker container run -p 8203:8203 --name node-server-container -d node-server:1.0